Skip to content

[K8s] Clean up terminated driver pods on informer add - #7632

Open
ruanwenjun wants to merge 1 commit into
apache:masterfrom
ruanwenjun:fix-k8s-terminated-pod-on-add
Open

[K8s] Clean up terminated driver pods on informer add#7632
ruanwenjun wants to merge 1 commit into
apache:masterfrom
ruanwenjun:fix-k8s-terminated-pod-on-add

Conversation

@ruanwenjun

@ruanwenjun ruanwenjun commented Aug 14, 2026

Copy link
Copy Markdown
Member

Why are the changes needed?

At startup, Kyuubi uses a separate one-time LIST to find and clean terminated driver pods. A pod can be missed if this LIST fails, or if it completes after the cleanup LIST observes it as running but is first reported by the informer as an ADD event. Since onAdd only records state and does not schedule cleanup, the pod may receive no further update and therefore remain in memory and not be deleted even when the cleanup strategy is ALL.

The informer already lists existing pods during initialization. Handling terminated pods in onAdd closes both gaps and makes the separate cleanup LIST unnecessary.

How was this patch tested?

Added mark terminated application received from pod add event to verify that a succeeded Spark driver pod received through ADD is registered in the terminated-application cleanup trigger. The test fails without the production change and passes with it.

Was this patch authored or co-authored using generative AI tooling?

Yes, using Codex: GPT-5

@ruanwenjun
ruanwenjun marked this pull request as ready for review August 14, 2026 02:54
@ruanwenjun
ruanwenjun force-pushed the fix-k8s-terminated-pod-on-add branch from 21f9152 to f5bb357 Compare August 14, 2026 06:06
- Handle terminated applications in SparkEnginePodEventHandler.onAdd.
- Remove cleanTerminatedAppPodsOnKubernetesClientInitialize and its executor.
@ruanwenjun
ruanwenjun force-pushed the fix-k8s-terminated-pod-on-add branch from f5bb357 to c4c3a03 Compare August 14, 2026 06:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant